﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Base_Game
{
    public class GameObject
    {
       
        public Matrix world;
               
        Model model;
        public bool colision;
        private GraphicsDevice device;
        private BasicEffect effect;
        //private VertexBuffer vertexBuffer;
        //private Vector3 orientation;
        //private VideoPlayer player;
                
        public GameObject(GraphicsDevice graphicsDevice,Matrix world,Model model,bool canColision)
        {

            this.colision = canColision;
            device = graphicsDevice;
            //this.player = player;
            this.model = model;
            this.world = world;
            effect = model.Meshes[0].Effects[0] as BasicEffect;
            (model.Meshes[0].Effects[0] as BasicEffect).EnableDefaultLighting();
            effect.TextureEnabled = true;
            //player.IsLooped = true;
       
            //Lembrar de apagar a linha matrix identity se a gente quiser mudar a posição
            //world = Matrix.Identity;

            // CORTAR EM POTENCIA DE 2 graphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;

        }

        public void Update(GameTime gameTime)
        {

        }

        public void Draw(Cam cam)
        {
            model.Draw(world, cam.View,cam.Projection);
            (model.Meshes[0].Effects[0] as BasicEffect).EnableDefaultLighting();
            //effect.Texture = player.GetTexture();


        }
    }
}
